package com.itheima.test02;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/*
复制文件之一次复制一个字节数组
 */
public class Test02 {

    public static void main(String[] args) throws IOException {

        FileInputStream fis = new FileInputStream("day12\\copy\\a.jpg");
        FileOutputStream fos = new FileOutputStream("day12\\copy\\b.jpg");

        byte[] bytes= new byte[1024];
        int len;
        while ((len=fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
            System.out.println("复制了一次");
            System.out.println("这一次复制了"+len);
        }
        fis.close();
        fos.close();

    }
}
